import { Get, PostJson, Post } from './request';

export interface IUser {
    id: number,
    username: string,
    salt?: string,
    email?: string,
    mobile?: string,
    status?: number,
    name?: string,
    areaId?: number,
    createTime?: string
}
/** 获取用户信息 */
export const getUserInfo = (userId: unknown):Promise<IUser> => Get(`/user/info${userId}`)

/** 所有用户列表 */
export const getUserList = (params: unknown):Promise<IUser[]> => Post('/user/list', params)

/** 修改密码 */
export const updatePassword = (data: unknown) => PostJson('/user/password', data)

/** 保存用户 */
export const saveUser = (data: unknown):Promise<IUser> => PostJson('/user/save', data)
